var express = require('express');
var router = express.Router();
var connection = require('../db/sql.js')
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});
router.get('/getimg', function(req, res, next) {
  connection.query("select * from imginfo",function(error,results,fields){
	  res.json(results);
  })
});
router.get('/chaxun', function(req, res, next) {
	var pram = req.query;
  connection.query("select * from articlelibrary where textid="+pram.id,function(error,results,fields){
	  res.json(results);
  })
});
module.exports = router;
